import { useSelector } from "react-redux"
import { useEffect } from "react"
export default (Com) => {
    return props => {
        const is = useSelector(state => state.login)
        useEffect(() => {
            if (!is.isAuth) {
                props.history.push('/login')
            }
        }, [is.isAuth])

        return <Com  {...props} />
    }
}